package com.slcf.service.impl;

import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.slcf.common.Constant;
import com.slcf.dao.WxConfigMapper;
import com.slcf.model.WxConfig;
import com.slcf.service.WeChatService;
import com.slcf.util.WeChatUtils;

@Service
public class WeChatServiceImpl implements WeChatService {

	@Autowired
	private WxConfigMapper wxConfigMapper;
	@Autowired
	private WeChatUtils weChatUtils;

	@Override
	public Map<String, String> getWxConfig(String url) {
		WxConfig wxConfig = wxConfigMapper.getWxConfigByAppId(Constant.WX_APP_ID);
		return weChatUtils.sign(url, wxConfig.getJsapiTicket());
	}

}
